<%@page import="com.google.apphosting.api.ApiProxy,com.google.apphosting.api.ApiProxy.Environment,com.google.appengine.api.users.UserServiceFactory,com.google.appengine.api.users.UserService,com.google.appengine.api.users.User,com.google.appengine.api.datastore.Entity" %>
<%
UserService userService=UserServiceFactory.getUserService();
User user=userService.getCurrentUser();
%>
<style>
#NavigationContainer{
	float:left;
	position:relative;
	padding:5px;
	margin:5px;
}
</style>
<script>
$(document).ready(function(){
	$('#NavigationContainer').buttonset();
	$('#Dashboard').click(function(){
		window.location.href="/";
	});
	$('#BusinessClient').click(function(){
		window.location.href="/businessclients.jsp";
	});
	$('#PersonalClient').click(function(){
		window.location.href="/personalclients.jsp";
	});
	$('#Report').click(function(){
		window.location.href="/reports.jsp";
	});
	<%
	Entity userEntity=(Entity)request.getAttribute("User");
	boolean isAdmin=false;
	if(userEntity!=null&&((String)userEntity.getProperty("Role")).equalsIgnoreCase("admin")){
		isAdmin=true;
	}
	if(isAdmin){
	%>
	$('#UserControl').click(function(){
		window.location.href="/usercontrol.jsp";
	});
	<%}%>
});
</script>
<img src="images/padgett_logo_small.jpg" width="190" height="118" alt="Padgett Logo">
<div style="float:left;position:relative;width:100%;">
<div id="NavigationContainer">
<input id="Dashboard" name="Navigation" type="radio"/><label for="Dashboard">Dashboard</label>
<input id="BusinessClient" name="Navigation" type="radio" checked="checked"/><label for="BusinessClient">Business Client</label>
<input id="PersonalClient" name="Navigation" type="radio"/><label for="PersonalClient">Personal Client</label>
<input id="Report" name="Navigation" type="radio"/><label for="Report">Report</label>
<%
if(isAdmin){
%>
<input id="UserControl" name="Navigation" type="radio"/><label for="UserControl">User Control</label>
<%} %>
</div>
<div style="float:right;position:relative;right:20px;height:50px;"><%
Environment env=ApiProxy.getCurrentEnvironment();
String version=env.getVersionId();
out.print("Version "+version+" - "+user.getEmail()+" - <a href='"+userService.createLogoutURL("/")+"'>Logout</a>");
%></div></div><hr/>